clear 
import delimited "10-Replicate-Ratings/02-clean-data/texts-joined-ratings-clean.csv"

//Offensive
//main effect
xi: reg offensive_avg female male noname i.experiment1, r 
di e(r2_a)
//Study 1 only
xi: reg offensive_avg female male noname if experiment1 == 1, r 
di e(r2_a)
//Study 2 only
xi: reg offensive_avg female male noname if experiment1 == 0, r 
di e(r2_a)

///By gender
///subset to women only
xi: reg offensive_avg female male noname i.experiment1 if gender=="female", r 
di e(r2_a)
///subset to men only
xi: reg offensive_avg female male noname i.experiment1 if gender=="male", r 
di e(r2_a)

//main effect
xi: ivreg offensive_avg i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname), r 
di e(r2_a)
//Study 1
xi: ivreg offensive_avg (femaleinstrument maleinstrument nonameinstrument = female male noname) if experiment1 == 1, r 
di e(r2_a)
//Study 2
xi: ivreg offensive_avg (femaleinstrument maleinstrument nonameinstrument = female male noname) if experiment1 == 0, r 
di e(r2_a)

///By gender
///subset to women only
xi: ivreg offensive_avg i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname) if gender=="female", r 
di e(r2_a)
///subset to men only
xi: ivreg offensive_avg i.experiment1 (femaleinstrument maleinstrument nonameinstrument = female male noname) if gender=="male", r 
di e(r2_a)

//Discouraging
//main effect
xi: reg discourage_avg female male noname i.experiment1, r 
di e(r2_a)
//Study 1 only
xi: reg offensive_avg female male noname if experiment1 == 1, r 
di e(r2_a)
//Study 2 only
xi: reg offensive_avg female male noname if experiment1 == 0, r 
di e(r2_a)

